import request from "../utils/request";

export const upload=(params)=>{
  return request({
    url:'/file/upload',
    method:'post',
    data:params
  })
}

export const deleteFileAPI=(params)=>{
  return request({
    url:'/file/deleteFile',
    method:'delete',
    params:{
      url:params
    }
  })
}

export const uploadAXIOS=(params)=>{
  return request({
    url:'/file/upload',
    method:'post',
    headers: {
      'Content-Type': 'multipart/form-data'
    },
    data:params
  })
}


export const importExcelAPI=(params)=>{
  return request({
    url:'/file/importExcel',
    method:'post',
    headers: {
      'Content-Type': 'multipart/form-data'
    },
    data:params
  })
}
//导出为excel
export const exportExcelAPI=()=>{
  return request({
    url:'/file/export',
    method:'post',
    // params:
  })
}

//以流的形式导出excel
export const exportExcelStreamAPI=()=>{
  return request({
    url:'/file/exportStream',
    method:'post',
    responseType:'blob'
    // responseType:'arraybuffer'
  })
}